
#ifndef _THREADPOOL_H
#define _THREADPOOL_H

struct ThreadPool;

// 创建线程吃并初始化
struct ThreadPool *threadPoolCreate(int min, int max, int queueSize);

// 销毁线程池
int threadPoolDestroy(struct ThreadPool* pool);

// 给线程池添加任务
void threadPoolAdd(struct ThreadPool* pool, void(*func)(void*), void* arg);

// 获取线程池工作的线程个数
int threadPoolBusyNumbber(struct ThreadPool* pool);

// 获取线程池活着的线程个数
int threadPoolAliveNumbber(struct ThreadPool* pool);

//////////////
void* worker(void* arg);
void* managet(void* arg);
void threadExit(struct ThreadPool* pool);

#endif //  _THREADPOOL_H